package com.alvin.abp.common.context;

import java.io.Serializable;

public class PaginationContext implements Serializable{
	private static final long serialVersionUID = -6681246151754639107L;
	
	public static final int DEFAULT_PAGE_SIZE = 10;
	
	private static ThreadLocal<PaginationContext> context= new ThreadLocal<PaginationContext>();


    private Integer current=1;

    private Integer chunk = 20;

    private Integer count;

    private Integer pageCount;

    private boolean newQuery;
    
	
	public boolean isNewQuery() {
		return newQuery;
	}

	public void setNewQuery(boolean newQuery) {
		this.newQuery = newQuery;
	}

	public Integer getCurrent() {
		return current;
	}

	public void setCurrent(Integer current) {
		this.current = current;
	}

	public Integer getChunk() {
		return chunk;
	}

	public void setChunk(Integer chunk) {
		this.chunk = chunk;
	}

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	public Integer getPageCount() {
		return pageCount;
	}

	public void setPageCount(Integer currentPageCount) {
		this.pageCount = currentPageCount;
	}

	public static PaginationContext get(){
		return context.get();
	}
	
	public static void set(PaginationContext ctx){
		context.set(ctx);
	}


}
